package net.hsxin.test.activiti.service;

import java.util.List;

import javax.annotation.Resource;

import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.springframework.stereotype.Service;

@Service
public class TasksService {
    
	@Resource
	private TaskService taskService;

	public TaskService getTaskService() {
		return taskService;
	}

	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}
	
	public void completeTask(String taskId)
	{
		this.taskService.complete(taskId);
	}
	
	public List<Task> listTasks(String processId)
	{
		return this.taskService.createTaskQuery().processInstanceId(processId).list();
	}
}
